home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / Sample Code / PartMaker 4.4 / PartMaker Documents / Script Runner• / Script Runner•.rsrc / dFRK_5034 < prev    next >
Encoding:
Text File  |  1995-12-12  |  4.2 KB  |  170 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: Orbit:SampleCode:ScriptRunner:OSAPlugIn:ScriptRunnerAgent.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. #ifndef SOM_Module_Sample_defined
  11. #define SOM_Module_Sample_defined 1
  12. #include <som.xh>
  13.  
  14. /*
  15.  * Start of user-defined types:
  16.  */
  17. class SOMClass;
  18. class SOMObject;
  19. class ODFrame;
  20. class ODFacet;
  21. class ODObject;
  22. class ODExtension;
  23. class ODPart;
  24. class ODDraft;
  25. #define kOSAScriptingTool "Apple Computer:OSA Scripting Tool"
  26.  
  27. /*
  28.  * End of user-defined types.
  29.  */
  30. #endif /* SOM_Module_Sample_defined */
  31.  
  32. #ifndef SOM_Sample_ScriptRunnerAgent_xh
  33. #define SOM_Sample_ScriptRunnerAgent_xh
  34.  
  35. class Sample_ScriptRunnerAgent;
  36.  
  37. #define Sample_ScriptRunnerAgent_MajorVersion 1
  38. #define Sample_ScriptRunnerAgent_MinorVersion 1
  39.  
  40. /* C++ SOM defs */
  41. #include <somcls.xh>
  42. #include <somcm.xh>
  43.  
  44. /* C++ parent defs */
  45. #ifndef SOM_ODObject_xh
  46. #include <ODObject.xh>
  47. #endif
  48.  
  49. #ifndef Sample_ScriptRunnerAgent_API
  50. #define Sample_ScriptRunnerAgent_API
  51. /*
  52.  * -- The Class API
  53.  */
  54.  
  55. /*
  56.  * Start of user-defined types:
  57.  */
  58.  
  59. /*
  60.  * End of user-defined types.
  61.  */
  62.  
  63. #ifdef OLDIBMSOMAPISUPPORT
  64. #define Sample_ScriptRunnerAgentCClassData Sample_ScriptRunnerAgentClassData
  65. #define Sample_ScriptRunnerAgentNewClass(major,minor) somNewVersionedClassReference(Sample_ScriptRunnerAgent,major,minor)
  66. #endif
  67.  
  68. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  69. #define Sample_ScriptRunnerAgentMetaClass SOMClass
  70.  
  71.  
  72. /* The API to the Sample_ScriptRunnerAgent class object, and the methods it introduces. */
  73. SOMEXTERN struct Sample_ScriptRunnerAgentClassDataStructure {
  74. #ifdef OLDIBMSOMAPISUPPORT
  75.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  76. #else
  77.     long zero;
  78. #endif
  79.     somStaticClassInfo *sci;
  80.     somDToken        instanceDataToken;
  81.     long reserved [3];
  82.     somMToken AcquireScriptRunner;
  83. } SOMDLINK Sample_ScriptRunnerAgentClassData;
  84.  
  85. #if !defined(Sample_ScriptRunnerAgent_Class_Source) && !defined(SOM_Module_scriptrunneragent_Source)
  86. #if PRAGMA_IMPORT_SUPPORTED
  87. #pragma import list Sample_ScriptRunnerAgentClassData
  88. #endif
  89. #endif
  90.  
  91.  
  92. /*
  93.  * -- Typedefs and inline method declarations for left path inherited methods
  94.  * -- are omitted because this compilation had -museinheritedmethods in effect
  95.  */
  96.  
  97.  
  98. /*
  99.  * -- Typedefs for Sample_ScriptRunnerAgent Method Procedures
  100.  */
  101. SOMEXTERN {
  102. typedef ODExtension*   (* SOMLINK somTD_Sample_ScriptRunnerAgent_AcquireScriptRunner)(Sample_ScriptRunnerAgent *somSelf, Environment *ev,
  103.         ODDraft* draft);
  104. }
  105.  
  106. #endif /* Sample_ScriptRunnerAgent_API */
  107.  
  108.  
  109. /*
  110.  * -- This emitter treats Method Tokens as Thunks by default.
  111.  * -- Use the sc modifier "nothunks" to change this default
  112.  */
  113. #undef somresolve_
  114. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  115.  
  116. /*
  117.  * -- The C++ Wrapper Class for Sample_ScriptRunnerAgent
  118.  */
  119. class Sample_ScriptRunnerAgent : public ODObject
  120. {
  121. public:
  122.  
  123. // Sample_ScriptRunnerAgent::new registers use of the class object, and then uses somNew
  124. // to allocate memory and load the object method table pointer. 
  125. void *operator new(size_t size)
  126. {
  127.     SOM_IgnoreWarning(size);
  128.     // Allocate memory using the default allocator for Sample_ScriptRunnerAgent, and
  129.     // clear mem & set method table pointer, call basic initialization
  130. #ifdef SOMCHKNULL
  131.     void * __somResult = (void *)
  132.       somNewObject(Sample_ScriptRunnerAgent);
  133.     SOMCHKNULL(__somResult);
  134.     return __somResult;
  135. #else
  136.     return (void*) somNewObject(Sample_ScriptRunnerAgent);
  137. #endif
  138. }
  139.  
  140. // Sample_ScriptRunnerAgent::delete uses the default deallocator for the object's class.
  141. void operator delete(void * obj)
  142. {
  143.     if (obj) {
  144.         SOM_Resolve(obj,SOMObject,somFree)
  145.            ( (SOMObject*) obj );
  146.     }
  147. }
  148.  
  149. /* method: AcquireScriptRunner */
  150. ODExtension*   AcquireScriptRunner(Environment *ev,
  151.         ODDraft* draft)
  152. {
  153.    #ifdef SOMCHKEXCEPT
  154.    ODExtension* __somResult = 
  155.       SOM_ResolveD(this,Sample_ScriptRunnerAgent,Sample_ScriptRunnerAgent,AcquireScriptRunner)
  156.     (this,ev,draft);
  157.       SOMCHKEXCEPT;
  158.    return __somResult;
  159. #else
  160.    return SOM_ResolveD(this,Sample_ScriptRunnerAgent,Sample_ScriptRunnerAgent,AcquireScriptRunner)
  161.     (this,ev,draft);
  162. #endif
  163. }
  164.  
  165. };   /* Sample_ScriptRunnerAgent */
  166.  
  167.  
  168.  
  169. #endif       /* SOM_Sample_ScriptRunnerAgent_xh */
  170.